﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:local="clr-namespace:SMIL.DrawingTools" 
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                    xmlns:DeepEarth_BingMapsToolkit_Client_Controls="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.GeometryStylePicker" 
                    xmlns:ee="http://schemas.microsoft.com/expression/2010/effects" 
                    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
                    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
                    xmlns:DeepEarth_BingMapsToolkit_Client_Controls1="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.ColorPicker" 
                    mc:Ignorable="d"
    >

    <ResourceDictionary.MergedDictionaries>
    	<ResourceDictionary Source="/DeepEarth.BingMapsToolkit.Client.Common;component/Resources/CommonStyles.xaml" />
    </ResourceDictionary.MergedDictionaries>

	<Style TargetType="local:DrawingTool">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="local:DrawingTool">
					<Grid x:Name="LayoutRoot">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="MyMouseStates">
								<VisualStateGroup.Transitions>
									<VisualTransition GeneratedDuration="0:0:0.3"/>
									<VisualTransition From="Normal" GeneratedDuration="0:0:0.3" To="MyMoueClick">
										<VisualTransition.GeneratedEasingFunction>
											<CircleEase EasingMode="EaseIn"/>
										</VisualTransition.GeneratedEasingFunction>
									</VisualTransition>
									<VisualTransition From="MyMoueClick" GeneratedDuration="0:0:0.3" To="Normal">
										<VisualTransition.GeneratedEasingFunction>
											<CircleEase EasingMode="EaseOut"/>
										</VisualTransition.GeneratedEasingFunction>
									</VisualTransition>
								</VisualStateGroup.Transitions>
								<VisualState x:Name="MyMoueClick">
									<Storyboard>
										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="grid">
											<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="301" KeySpline="0,0,0,1"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
								<VisualState x:Name="Normal"/>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Grid x:Name="grid" Margin="0,-228,-416,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Width="Auto" HorizontalAlignment="Left" Height="Auto">
							<Grid.RenderTransform>
								<CompositeTransform/>
							</Grid.RenderTransform>
							<Border CornerRadius="8" Background="#FF7C7C7C" Margin="0" Padding="2" Width="Auto" >
								<DeepEarth_BingMapsToolkit_Client_Controls:GeometryStylePicker 
									x:Name="PART_geometryStylePicker" VerticalAlignment="Top" Margin="0,0,0,0" HorizontalAlignment="Left" Width="Auto" Grid.ColumnSpan="2" />
							</Border>
						</Grid>
						<StackPanel Orientation="Horizontal" d:LayoutOverrides="Height" HorizontalAlignment="Left" Margin="0,0,4,0">
							<ComboBox Height="44" Width="64" SelectedIndex="0" HorizontalAlignment="Left" Style="{StaticResource ComboBoxStyle}" x:Name="PART_drawingComboBox" VerticalAlignment="Center">
								<ComboBoxItem x:Name="PART_cbICurrentItem">
									<StackPanel Orientation="Horizontal">
										<ToggleButton x:Name="PART_tbSelected" 
											VerticalAlignment="Top" 
											HorizontalAlignment="Left" 
											Margin="0" 
											Style="{StaticResource ToggleButtonStyle}"
                            	>
											<Image x:Name="PART_drawingImage" Source="/SMIL.DrawingTools;component/Images/PinIconForMeny.png" Stretch="Uniform" Width="23" Height="39" />
										</ToggleButton>
									</StackPanel>
								</ComboBoxItem>
								<ComboBoxItem>
									<StackPanel Orientation="Horizontal">
										<ToggleButton x:Name="PART_tbPoint" 
											VerticalAlignment="Top" 
											HorizontalAlignment="Left" 
											Margin="0" 
											Style="{StaticResource ToggleButtonStyle}"
											ToolTipService.ToolTip="Point"
                                >
											<Image Source="/SMIL.DrawingTools;component/Images/PinIconForMeny.png" Stretch="Uniform" Height="44" Width="32" />
										</ToggleButton>

										<ToggleButton x:Name="PART_tbLine" 
											VerticalAlignment="Top" 
											HorizontalAlignment="Left" 
											Margin="0" 
											Style="{StaticResource ToggleButtonStyle}"
											ToolTipService.ToolTip="Line/Polyline"
                            >
											<Image Source="/SMIL.DrawingTools;component/Images/Line.png" Stretch="Uniform" Height="44" Width="32" />
										</ToggleButton>


										<ToggleButton x:Name="PART_tbPolygon" 
											VerticalAlignment="Top" 
											HorizontalAlignment="Left" 
											Margin="0" 
											Style="{StaticResource ToggleButtonStyle}"
											ToolTipService.ToolTip="Polygon"
                            >
                                            <Image Source="/SMIL.DrawingTools;component/Images/Polygon.png" Stretch="Uniform" Height="44" Width="32" />
										</ToggleButton>
                                        <ToggleButton x:Name="PART_tbFreeDraw" 
											VerticalAlignment="Top" 
											HorizontalAlignment="Left" 
											Margin="0" 
											Style="{StaticResource ToggleButtonStyle}"
											ToolTipService.ToolTip="Free draw"
                            >
                                            <Image Source="/SMIL.DrawingTools;component/Images/Draw.png" Stretch="Uniform" Height="44" Width="32" />
                                        </ToggleButton>
                                    </StackPanel>
								</ComboBoxItem>
							</ComboBox>
							<Button  Margin="4,0,0,0" Style="{StaticResource ButtonStyle}" x:Name="PART_bColor" IsEnabled="False" VerticalAlignment="Center" HorizontalAlignment="Left" Height="44" Width="34">
								<Image Height="40" Source="/SMIL.DrawingTools;component/Images/Color.png" Stretch="Uniform" Width="Auto"/>
							</Button>
							<Button Visibility="Collapsed"  Margin="4,0,0,0" Style="{StaticResource ButtonStyle}" x:Name="PART_bSave" VerticalAlignment="Center" IsEnabled="False" HorizontalAlignment="Left" Height="44">
								<Image Source="/SMIL.DrawingTools;component/Images/Save.png" Stretch="Uniform" Height="40" Width="28" />
							</Button>
                            
                            <ToggleButton Margin="4,0,0,0" Style="{StaticResource ToggleButtonStyle}" x:Name="PART_bDelete" VerticalAlignment="Center" HorizontalAlignment="Left" Height="44" IsEnabled="False">
                                <ToggleButton.Content>
                                    <Image Source="/SMIL.DrawingTools;component/Images/Delete.png" Stretch="Uniform" Width="28" />
                                </ToggleButton.Content>
                            </ToggleButton>
                            <Button  Margin="4,0,0,0" Style="{StaticResource ButtonStyle}" x:Name="PART_bSaveDrawing" VerticalAlignment="Center" IsEnabled="True" HorizontalAlignment="Left" Height="44">
                            	<Image x:Name="PART_iSaveDrawing" Source="/SMIL.DrawingTools;component/Images/Save.png" Stretch="Uniform" Height="40" Width="28" />
                            </Button>

						</StackPanel>
						
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>
